package zoo;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

import world.Mammal;
//泛型，，
public class Zoo<T extends Mammal> {
	private T[] ts;
	private int max=100;
	private int cp=0;
	
	public Zoo(){
		//强转为T类型
		ts=(T[])(new Object[max]);
	}
	
	public void add(T t){
		ts[cp++]=t;
		
	}
	
	public T get(int index){
		return ts[index];
		
	}
	public static void main(String[] args) {
		int a=8;
//		char b='b';
		System.out.println();
		Object object=null;
		if(object!=null){
			object.toString();
		}
		int []m=new int[8];
		if(a<m.length){
			int b=m[a];
		}
		if (object instanceof String) {
			String s=(String)object;
			
		}
		try {//警戒区
			FileInputStream fileInputStream = new FileInputStream("1223");
		} catch (FileNotFoundException e) {
//			catch (Throwable e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		finally{
			//始终执行
			
		}
			
	}
	

}
